package DataAccess;

import DataAccess.*;

/** 
 Data Access Layer Object Collection Of CaiZhong
*/
public class AgentCollection extends DataAccessCollectionBase
{
//C# TO JAVA CONVERTER TODO TASK: There is no preprocessor in Java:
		///#region ����ͻ���
	public AgentCollection()
	{
		super();
	}
	@Override
	protected DataTable BuildTable()
	{
		DataTable dt = new DataTable();
		dt.Columns.Add("Id",Integer.class);
		dt.Columns.Add("domain",String.class);
		dt.Columns.Add("uname",String.class);
		dt.Columns.Add("agentId",Integer.class);
		dt.Columns.Add("cp_user",String.class);
		return dt;
	}
	@Override
	protected DataAccessBase GetItemByIndex(int index)
	{
		return new Agent(_DataTable.Rows[index]);
	}
//C# TO JAVA CONVERTER TODO TASK: There is no preprocessor in Java:
		///#endregion ����ͻ���
//C# TO JAVA CONVERTER TODO TASK: There is no preprocessor in Java:
		///#region ����
	public final DataTable getTable()
	{
		return super._DataTable;
	}
	public final Agent getItem(int index)
	{
		return new Agent(_DataTable.Rows[index]);
	}
	public final void setItem(int index, Agent value)
	{
		_DataTable.Rows.RemoveAt(index);
		_DataTable.Rows.InsertAt(value.getDataRow(),index);
	}
	public enum Field
	{
		Id,
		domain,
		uname,
		agentId,
		cp_user;

		public int getValue()
		{
			return this.ordinal();
		}

		public static Field forValue(int value)
		{
			return values()[value];
		}
	}
//C# TO JAVA CONVERTER TODO TASK: There is no preprocessor in Java:
		///#endregion ����
//C# TO JAVA CONVERTER TODO TASK: There is no preprocessor in Java:
		///#region ��������
	protected final boolean ListByCondition(String condition)
	{
		String sql = "" + "\r\n" +
"				Select" + "\r\n" +
"					*" + "\r\n" +
"				  From CaiZhong" + "\r\n" +
"				 Where " + condition + "\r\n" +
"			";
		return super.ListBySql(sql);
	}

	public final boolean ListAll()
	{
		String condition = "1=1";
		return ListByCondition(condition);
	}

	public final boolean ListByCpUser(String Cp_User)
	{
		String condition = "1=1 and cp_user = " + Helper.ToSQLParamStr(Cp_User);
		return ListByCondition(condition);
	}
//C# TO JAVA CONVERTER TODO TASK: There is no preprocessor in Java:
		///#endregion ��������
//C# TO JAVA CONVERTER TODO TASK: There is no preprocessor in Java:
		///#region ���淽��

//C# TO JAVA CONVERTER TODO TASK: There is no preprocessor in Java:
		///#endregion ���淽��
}